import http from '../../../base/api/public'
import querystring from 'querystring'
let sysConfig = require('@/../config/sysConfig')
let apiUrl = sysConfig.xcApiUrlPre;

//页面查询
export const page_list=(page,size,params)=>{
    let query='1=1';
    if (params.siteId) {
      query +='&siteId='+params.siteId;
    }
    if(params.templateId){
      query +='&templateId='+params.templateId;
    }
    if(params.pageAliase){
      query +='&pageAliase='+params.pageAliase;
    }
    //请求服务端的页面查询接口
    // return http.requestQuickGet('http://localhost:31001/cms/page/list/'+page+'/'+size);
    return http.requestQuickGet(apiUrl+'/cms/page/list/'+page+'/'+size+'?'+query);
}

//模板查询
export const template_list=()=>{
  return http.requestPost(apiUrl+'/cms/template/list');
}

//添加页面
export const page_add= params =>{
  return http.requestPost(apiUrl+'/cms/page/add',params);
}

//根据页面id查询
export const page_get=(params) =>{
  return http.requestQuickGet(apiUrl+'/cms/page/get/'+params);
}

//编辑页面

export const page_edit=(pageId,params) =>{
  return http.requestPut(apiUrl+'/cms/page/edit/'+pageId,params);
}

//删除页面
export const page_delete=(pageId)=>{
  return http.requestDelete(apiUrl+'/cms/page/delete/'+pageId);
}




